package corestruct

import (
	"reflect"
)

type MyClass struct {
	Ename    string `json:"ename"                            gorm:"column:ename;DEFAULT:'';not null;comment:类英文名;"`
	Name     string `json:"name"                             gorm:"column:name;DEFAULT:'';not null;comment:类名称;"`
	FullName string `json:"fullName"                         gorm:"column:full_name;DEFAULT:'';not null;comment:类全名;"`
	Memo     string `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:类备注;"`
	BaseType string `json:"baseType"                         gorm:"column:base_type;DEFAULT:'';not null;comment:基类;memo:entity、dto、qto;"`

	Fileds       []MyField
	PrjName      string
	reflect.Type ``
}

func (p *MyClass) FindField(fieldName string) *MyField {
	for _, mf := range p.Fileds {
		if mf.Ename == fieldName {
			return &mf
		}
	}
	return nil
}
